package com.charmpeach.tsss.crawler;

import java.util.Date;


public class CourseInfoMessage implements Comparable<CourseInfoMessage>
{

	private String courseName;
	private String instructor;
	private String type;
	private String content;
	private Date time;
	private CourseTag tag;
	
	public CourseInfoMessage(String courseName, String instructor, String type, String content, Date time, CourseTag tag)
	{
		super();
		
		this.courseName = courseName;
		this.instructor = instructor;
		this.type = type;
		this.content =content;
		this.time = time;
		this.tag = tag;
	}
	
	@Override
	public int compareTo(CourseInfoMessage anotherCourseInfoMessage)
	{
		// TODO Auto-generated method stub
		return time.compareTo(anotherCourseInfoMessage.time);
	}

	public String  toString()
	{
		String result = "";
		result += courseName + ",";
		result += instructor + ",";
		result += type + ",";
		result += content + ",";
		result += tag.toString() + ";";
		
		return result;
	}
}
